package cm.sms.controller;

import cm.exception.CommonResult;
import cm.sms.dto.SmsSendDTO;
import cm.sms.service.SmsService;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @author: yxh
 * @Description: 短信发送
 * @Date: Created in 2022/9/20 10:43
 * @Modified By:
 */
@RestController
@RequestMapping("/sms/send/")
@Slf4j
public class SmsController {

    @Resource
    private SmsService smsService;

    @RequestMapping(value = "sendCode")
    @ApiOperation(value = "发送验证码")
    public CommonResult<Boolean> sendSmsCode(@RequestBody @Validated SmsSendDTO smsSendDTO){
        smsService.sendSmsCode(smsSendDTO);
        return CommonResult.success(true);
    }

}
